package com.chinacoal.hr.levelapi.client;

import com.chinacoal.hr.levelapi.client.fallback.AttendanceAppealClientFallback;
import com.chinacoal.hr.levelapi.client.response.Result;
import com.chinacoal.hr.levelapi.entity.AttendanceAppeal;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.cloud.openfeign.FeignAutoConfiguration;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

/**
 * Created by jinyabin on 2020/10/29.
 */
@Api(tags = {"考勤申诉信息"})
@FeignClient(name = "ccip-hr-attendance",configuration = FeignAutoConfiguration.class,fallback = AttendanceAppealClientFallback.class)
public interface AttendanceAppealClient {


    /**
     * @param page  :当前页数
     * @param limit :每页条数
     * @param orgCode :组织编码
     * @param yrmonth :月份
     * @param empNo :员工姓名或编号
     * @return : com.chinacoal.hr.levelapi.response.Result
     * @author : YunTao.Li
     * @date : 2019/11/14 2019/11/14
     */
    @ResponseBody
    @GetMapping("/appeals")
    @ApiOperation(value = "查询考勤申诉信息")
    Result list(@ApiParam("当前页数") Long page,
                @ApiParam("每页条数") Long limit,
                @ApiParam("组织编码") String orgCode,
                @ApiParam("月份") String yrmonth,
                @ApiParam("员工姓名或编号") String empCode,
                @ApiParam("考勤申诉编码") String explainCode);





    /**
     * 查询考勤申诉下的考勤申诉明细数据
     *
     * @param explainId :
     * @return : com.chinacoal.hr.levelapi.response.Result
     * @author : YunTao.Li
     * @date : 2019/11/28 2019/11/28
     */
    @ResponseBody
    @GetMapping("/appeal/{explainId}/details")
    @ApiOperation(value = "查询考勤申诉明细信息")
     Result list(
            @PathVariable String explainId) ;



    /**
     * 新增考勤申诉单
     *
     * @param record :
     * @return : com.chinacoal.hr.levelapi.response.Result
     * @author : YunTao.Li
     * @date : 2019/11/21 2019/11/21
     */
    @PostMapping("/appeal")
    @ApiOperation(value = "新增考勤申诉单")
     Result add(@RequestBody AttendanceAppeal record);



    /**
     * 编辑考勤申诉单
     *
     * @param explainId        :
     * @param attendanceAppeal :
     * @return : com.chinacoal.hr.levelapi.response.Result
     * @author : YunTao.Li
     * @date : 2019/11/19 2019/11/19
     */
    @PutMapping("/appeal/{explainId}")
    @ApiOperation(value = "编辑考勤申诉单")
     Result update(@PathVariable String explainId,
                         @RequestBody AttendanceAppeal attendanceAppeal) ;



    /**
     * 删除考勤申诉
     *
     * @param explainId :
     * @return : com.chinacoal.hr.levelapi.response.Result
     * @author : YunTao.Li
     * @date : 2019/11/26 2019/11/26
     */
    @DeleteMapping("/appeal/{explainId}")
    @ApiOperation(value = "删除考勤申诉")
     Result delete(@PathVariable String explainId) ;


    /**
     * 提交考勤申诉
     *
     * @param explainId :
     * @param record    :
     * @return : com.chinacoal.hr.levelapi.response.Result
     * @author : YunTao.Li
     * @date : 2019/11/26 2019/11/26
     */
    @PutMapping("/appeal/{explainId}/submit")
    @ApiOperation(value = "提交考勤申诉")
     Result submit(@PathVariable String explainId,
                         @RequestBody AttendanceAppeal record) ;



    /**
     * 撤回考勤申诉
     * @author : YunTao.Li
     * @date : 2019/12/12 2019/12/12
     * @param explainId :
     * @param record :
     * @return : com.chinacoal.hr.levelimpl.response.Result
     */
    @PutMapping("/appeal/{explainId}/drawback")
    @ApiOperation(value = "撤回考勤申诉")
     Result drawback(@PathVariable String explainId,
                           @RequestBody AttendanceAppeal record) ;


}
